feat(banner): add pf-v6-banner#3143
Conversation
|
✅ Commitlint tests passed!More Info{
"valid": true,
"errors": [],
"warnings": [],
"input": "feat(banner): add pf-v6-banner"
} |
✅ Deploy Preview for patternfly-elements ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
| @property({ type: Boolean, reflect: true }) sticky = false; | ||
|
|
||
| /** Text announced by screen readers to indicate the type of banner. */ | ||
| @property({ attribute: 'screen-reader-text' }) screenReaderText?: string; |
There was a problem hiding this comment.
this attribute name is vague: it's not immediately clear which text this is. only after reading the jsdoc does the user discover that this text describes the "type" of banner. "type", mind you, is not an attribute on this element, so that term is also vague. moreover, we use accessible-label as the name for screen reader texts in other elements.
@adamjohnson wdyt?
There was a problem hiding this comment.
It's directly from React, screenReaderText is the prop name in Banner.tsx. The agent mapped it to screen-reader-text as the HTML attribute (dash-case convention).
I definitely think this is where we can make a judgment call, but we have to ensure we are consistent across the board here.
| return html` | ||
| <div id="container" class=${classMap({ | ||
| [this.color ?? '']: !!this.color, | ||
| [this.status ?? '']: !!this.status, | ||
| })}> | ||
| ${!this.screenReaderText ? nothing |
There was a problem hiding this comment.
| return html` | |
| <div id="container" class=${classMap({ | |
| [this.color ?? '']: !!this.color, | |
| [this.status ?? '']: !!this.status, | |
| })}> | |
| ${!this.screenReaderText ? nothing | |
| const { color = '', status = '' } = this; | |
| return html` | |
| <div id="container" class="${classMap({ [color]: !!color, [status]: !!status })}"> | |
| ${!this.screenReaderText ? nothing |
minor formatting nit
| ${!this.screenReaderText ? nothing | ||
| : html`<span class="sr-only">${this.screenReaderText}</span>`} | ||
| <slot></slot> | ||
| </div> |
There was a problem hiding this comment.
| ${!this.screenReaderText ? nothing | |
| : html`<span class="sr-only">${this.screenReaderText}</span>`} | |
| <slot></slot> | |
| </div> | |
| <span class="sr-only" ?hidden="${!this.screenReaderText}">${this.screenReaderText}</span> | |
| <slot></slot> | |
| </div> |
|
this should delete pf-v5-banner and update all references |
Ok, good, that answers a question I had about the exports previously. We could update the |
Summary
Closes #2983
pf-v6-bannerelement ported from pf-v5-banner and aligned with the React v6 Banner componentvariantattribute with separatecolor(8 decorative colors) andstatus(5 semantic statuses) attributes, matching React's split APIscreen-reader-textattribute for visually-hidden status announcements (WCAG 1.3.1)stickyattribute (maps to ReactisSticky)iconattribute/slot — icons are now composed in the default slot, matching React v6light-dark()for standalone usageDeviations from React
pf-v5-icon: The status demo composes icons in the default slot usingpf-v5-iconbecausepf-v6-iconis not yet merged tostaging/pfv6. Once pf-v6-icon lands, the status demo should be updated to usepf-v6-iconwith therh-ui-*-fillicon set to match the React demos visually.isStickyas a prop but no dedicated demo on patternfly.org. We include a standalone sticky demo since the behavior requires scrollable content to verify — this was carried forward from the v5 element.Test plan
/review-a11y— no critical issues/review-api— no critical issues/review-demos— all demos match patternfly.org paritycem health— 87/100 (above 80% threshold)http://localhost:8000/elements/banner/demo/{slug}?rendering=chromeless🤖 Generated with Claude Code